package com.rightsidetech.user.dtos.requst;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;

@Data
public class UserAddAddressReq implements Serializable {
    @ApiModelProperty(value = "收货人姓名", required = true)
    @NotBlank(message = "收货人姓名必填项不能为空")
    @Length(max = 16, message = "收货人姓名长度过长")
    @Pattern(regexp = "^[0-9a-zA-Z\\u4e00-\\u9fa5]+$", message = "姓名不能含有数字及特殊字符")
    private String userName;
    @ApiModelProperty(value = "收货人手机号", required = true)
    @NotEmpty(message = "收货人手机号必填项不能为空")
    @Pattern(regexp = "^1[3-9][0-9]{9}$", message = "请输入正确的手机号")
    private String userPhone;

    @ApiModelProperty(value = "地址")
    @NotBlank(message = "地址必填项不能为空")
    @Length(max = 50, message = "地址长度过长")
    @Pattern(regexp = "^[0-9a-zA-Z()（）,.?!，。？“”·、\\s+\\-\"\"=\\u4e00-\\u9fa5]{0,}$", message = "地址不支持特殊字符")
    private String address;

    @ApiModelProperty(value = "详细地址", required = true)
//    @NotBlank(message = "详细地址不能为空")
    @Length(max = 20, message = "详细地址长度过长")
    @Pattern(regexp = "^[0-9a-zA-Z()（）,.?!，。？“”·、\\s+\\-\"\"=\\u4e00-\\u9fa5]{0,}$", message = "详细地址不支持特殊字符")
    private String addressDetails;

    @ApiModelProperty(value = "是否默认: 0否 1是", required = true)
    @Range(min = 0, max = 1, message = "默认地址参数错误")
    @NotNull(message = "默认地址标识不能为空")
    private Byte isDefault;


    @ApiModelProperty("经度")
    @NotNull(message = "经度不能为空")
    private BigDecimal longitude;

    @ApiModelProperty("纬度")
    @NotNull(message = "纬度不能为空")
    private BigDecimal latitude;



    @ApiModelProperty(value = "省份",hidden = true)
    private String provice;
    @ApiModelProperty(value = "城市",hidden = true)
    private String city;
    @ApiModelProperty(value = "区域",hidden = true)
    private String area;


}
